<template>
    <h3>理财信息显示</h3>
    <table>
        <thead>
            <tr>
                <td><input type="checkbox"></td>
                <td>项目名称</td>
                <td>年收益</td>
                <td>月收益</td>
                <td>最低金额</td>
                <td>理财人数</td>
                <td>风险等级</td>
                <td>利息</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="item in str" :key="item.F_Id" :value="item.F_Id">
                <td><input type="checkbox"></td>
                <td>{{ item.F_Name }}</td>
                <td>{{ item.F_Year }}</td>
                <td>{{ item.F_Month }}</td>
                <td>{{ item.MinMoney }}</td>
                <td>{{ item.Number }}</td>
                <td>{{ item.Level }}</td>
                <td>{{ item.I_Inverest }}</td>
            </tr>
        </tbody>
    </table>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import axios from 'axios'

const str = ref([
    {
        F_Name: "",
        F_Year: 0,
        F_Month: 0,
        MinMoney: 0,
        Number: 0,
        Level: "",
        I_Inverest: "",
        F_Id: 0
    }
])

onMounted(() => {
    axios.get('http://localhost:56486/api/Financing/ShowFinancing')
        .then(res => {
            str.value = res.data;
        })
        .catch(error => {
            console.log(error);
        })
})
</script>